<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span {}

        .one {
            float: left;
            width: 200px;
            height: 200px;
            background-color: pink;
        }

        .two {

            width: 200px;
            height: 200px;
            background-color: red;
        }

        img {
            width: 300px;
            height: 300px;
        }

        .tre {
            width: 500px;
            height: 500px;
            background-color: cyan;
        }
    </style>
    <script>
        var obj = {
            a: 1
        }
        var obj2 = {
            b: obj
        }
        obj.c = obj2
        function deepClone(obj, map = new Map()) {
            if (obj instanceof RegExp) return new RegExp(obj)
            if (obj instanceof Date) return new Date(obj)

            if (typeof obj !== "object" || obj === null) return obj;

            let newObj = Array.isArray(obj) ? [] : {}
            if (map.get(obj)) {
                return map.get(obj);
            }
            map.set(obj, newObj);

            for (var attr in obj) {
                if (Object.prototype.hasOwnProperty.call(obj, attr)) {
                    newObj[attr] = deepClone(obj[attr], map)
                }
            }
            return newObj
        }
        console.log(deepClone(obj));
        const arr = [1, 2, 3, 4]
        const clone = (arr) => {
            return JSON.parse(JSON.stringify(arr))
        }
        const brr = clone(arr)
        brr[0] = 11
        console.log(arr);
    </script>
</head>

<body>
    <h1>123</h1>
    <span>123456123113213</span>
    <div class="one"><img src="C:\Users\29514\Desktop\xm\eftp-ui\src\assets\image\wxsq.png" alt=""></div>
    <div class="two">
        <div class="tre"></div>
    </div>
    <script>
        const test = { "a": { "n1": 1, "n2": 3 }, "b": { "n1": 2, "n2": 4 }, "c": { "n1": 3, "n2": 5 } }
        function map(test) {
            const obj = {}
            Object.keys(test).forEach(key => {
                const itemObject = test[key]
                Object.keys(itemObject).forEach(k => {
                    if (!obj[k]) {
                        obj[k] = {}
                    }
                    obj[k][key] = itemObject[k]
                })
            })
            return obj
        }
       console.log( map(test));
    </script>

</html>